$(function(){
	//左侧
	$('.nav-one').each(function(){
		var num = $(".nav-one").length;
		$(this).click(function(){
			if($(this).children('img:eq(0)').attr('src').indexOf('selected')>-1)
				retrun;
			$('.foot-nav-b ul li img').each(function(){
				$(this).attr('src','images/'+$(this).attr('id')+'.png');
			});
			$('.nav-one').each(function(){
			$(this).children('img:eq(0)').attr('src','images/'+$(this).children('img:eq(0)').attr('id')+'.png');
			});	
			$(this).children('img:eq(0)').attr('src','images/'+$(this).children('img:eq(0)').attr('id')+'_selected.png');
			var height=0;
			$(this).next('.nav-tow').children('p').each(function(){
				$(this).children('a').css('color','#ffbc4d');
			    height+=$(this).children('a').outerHeight();
			});
			if(height>($('.nav').height()-num*$(".nav-one").outerHeight()));
			height=$('.nav').height()-num*$(".nav-one").outerHeight();
			$(this).next('.nav-tow').height(height);
			$('.nav-tow').hide(500);
			$(this).next(".nav-tow").show(500);
	   	    $(this).addClass("nav-one-select").siblings().removeClass("nav-one-select");
		});
	});
	$('.nav-tow a').each(function(){
		$(this).click(function(){
			$('.nav-tow a').removeClass('active');
			$(this).addClass('active');
		});
	});
   //下方
   $('.foot-nav-b ul li img').each(function(){
		$(this).click(function(){
			$('.nav-one').each(function(){
			   $(this).children('img:eq(0)').attr('src','images/'+$(this).children('img:eq(0)').attr('id')+'.png');
			});
			$('.nav-tow').hide(500);
			$('.nav-one').removeClass("nav-one-select");
			$('.foot-nav-b ul li img').each(function(){
				$(this).attr('src','images/'+$(this).attr('id')+'.png');
			});
			$(this).attr('src','images/'+$(this).attr('id')+'_selected.png');
		});
	});
})


//局部刷新
function changeMain(filename){
	$("#frameReft").load(filename+".html");
}